package com.xinxing.city.recovery.entitys;

import android.widget.ImageView;
import android.widget.TextView;

import androidx.databinding.BindingAdapter;

import com.bumptech.glide.Glide;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.xinxing.city.recovery.Constant;
import com.xinxing.city.recovery.R;
import com.xinxing.city.recovery.net.OkHttpRequest;

@JsonIgnoreProperties(ignoreUnknown = true)
public class BucketType {
    private String code;
    private String name;
    private String companyCode;

    private String companyName;
    private String cabinetCode;
    private String cabinetName;
    private String status;
    private String overFlowStatus = "f";
    private String compressStatus;
    private String defaultPkgPrice;
    private String recycleCataCode;
    private String recycleCataName;
    private String unitName;
    private String unitCode;
    private String totalWeight;
    private String capacity;//容量
    private String usedCapacity;
    private String usageProportion;
    private String equipmentModel;
    private String manufacturer;
    private String rfidCode;
    private String cityCode;
    private String cityName;
    private String cityDistrict;
    private String countyDistrict;
    private String countyCode;
    private String countyName;
    private String zoneCode;
    private String zoneName;
    private String address;
    private String longitude;
    private String latitude;
    private String creatorCode;
    private String creatorName;
    private String lastUpdateCode;
    private String lastUpdateName;
    private long updated;
    private long created;
    private String icon;
    private String hardwareCode;
    private String hardwareName;
    private String hardwareLevel;
    private float weight;
    private int num =1;

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCompanyCode() {
        return companyCode;
    }

    public void setCompanyCode(String companyCode) {
        this.companyCode = companyCode;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getCabinetCode() {
        return cabinetCode;
    }

    public void setCabinetCode(String cabinetCode) {
        this.cabinetCode = cabinetCode;
    }

    public String getCabinetName() {
        return cabinetName;
    }

    public void setCabinetName(String cabinetName) {
        this.cabinetName = cabinetName;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getOverFlowStatus() {
        return overFlowStatus;
    }

    public void setOverFlowStatus(String overFlowStatus) {
        this.overFlowStatus = overFlowStatus;
    }

    public String getCompressStatus() {
        return compressStatus;
    }

    public void setCompressStatus(String compressStatus) {
        this.compressStatus = compressStatus;
    }

    public String getDefaultPkgPrice() {
        return defaultPkgPrice;
    }

    public void setDefaultPkgPrice(String defaultPkgPrice) {
        this.defaultPkgPrice = defaultPkgPrice;
    }

    public String getRecycleCataCode() {
        return recycleCataCode;
    }

    public void setRecycleCataCode(String recycleCataCode) {
        this.recycleCataCode = recycleCataCode;
    }

    public String getRecycleCataName() {
        return recycleCataName;
    }

    public void setRecycleCataName(String recycleCataName) {
        this.recycleCataName = recycleCataName;
    }

    public String getUnitName() {
        return unitName;
    }

    public void setUnitName(String unitName) {
        this.unitName = unitName;
    }

    public String getUnitCode() {
        return unitCode;
    }

    public void setUnitCode(String unitCode) {
        this.unitCode = unitCode;
    }

    public String getTotalWeight() {
        return totalWeight;
    }

    public void setTotalWeight(String totalWeight) {
        this.totalWeight = totalWeight;
    }

    public String getCapacity() {
        return capacity;
    }

    public void setCapacity(String capacity) {
        this.capacity = capacity;
    }

    public String getUsedCapacity() {
        return usedCapacity;
    }

    public void setUsedCapacity(String usedCapacity) {
        this.usedCapacity = usedCapacity;
    }

    public String getUsageProportion() {
        return usageProportion;
    }

    public void setUsageProportion(String usageProportion) {
        this.usageProportion = usageProportion;
    }

    public String getEquipmentModel() {
        return equipmentModel;
    }

    public void setEquipmentModel(String equipmentModel) {
        this.equipmentModel = equipmentModel;
    }

    public String getManufacturer() {
        return manufacturer;
    }

    public void setManufacturer(String manufacturer) {
        this.manufacturer = manufacturer;
    }

    public String getRfidCode() {
        return rfidCode;
    }

    public void setRfidCode(String rfidCode) {
        this.rfidCode = rfidCode;
    }

    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getCityDistrict() {
        return cityDistrict;
    }

    public void setCityDistrict(String cityDistrict) {
        this.cityDistrict = cityDistrict;
    }

    public String getCountyDistrict() {
        return countyDistrict;
    }

    public void setCountyDistrict(String countyDistrict) {
        this.countyDistrict = countyDistrict;
    }

    public String getCountyCode() {
        return countyCode;
    }

    public void setCountyCode(String countyCode) {
        this.countyCode = countyCode;
    }

    public String getCountyName() {
        return countyName;
    }

    public void setCountyName(String countyName) {
        this.countyName = countyName;
    }

    public String getZoneCode() {
        return zoneCode;
    }

    public void setZoneCode(String zoneCode) {
        this.zoneCode = zoneCode;
    }

    public String getZoneName() {
        return zoneName;
    }

    public void setZoneName(String zoneName) {
        this.zoneName = zoneName;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public String getCreatorCode() {
        return creatorCode;
    }

    public void setCreatorCode(String creatorCode) {
        this.creatorCode = creatorCode;
    }

    public String getCreatorName() {
        return creatorName;
    }

    public void setCreatorName(String creatorName) {
        this.creatorName = creatorName;
    }

    public String getLastUpdateCode() {
        return lastUpdateCode;
    }

    public void setLastUpdateCode(String lastUpdateCode) {
        this.lastUpdateCode = lastUpdateCode;
    }

    public String getLastUpdateName() {
        return lastUpdateName;
    }

    public void setLastUpdateName(String lastUpdateName) {
        this.lastUpdateName = lastUpdateName;
    }

    public long getUpdated() {
        return updated;
    }

    public void setUpdated(long updated) {
        this.updated = updated;
    }

    public long getCreated() {
        return created;
    }

    public void setCreated(long created) {
        this.created = created;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getHardwareCode() {
        return hardwareCode;
    }

    public void setHardwareCode(String hardwareCode) {
        this.hardwareCode = hardwareCode;
    }

    public String getHardwareName() {
        return hardwareName;
    }

    public void setHardwareName(String hardwareName) {
        this.hardwareName = hardwareName;
    }

    public String getHardwareLevel() {
        return hardwareLevel;
    }

    public void setHardwareLevel(String hardwareLevel) {
        this.hardwareLevel = hardwareLevel;
    }

    public float getWeight() {
        return weight;
    }

    public void setWeight(float weight) {
        this.weight = weight/1000;
    }

    @BindingAdapter("bucketCode")
    public static void getBucketCode(TextView view,String text){
        String res = (text.replace("0","")).replace("S","");
        view.setText("NO."+res);
    }
    @BindingAdapter("petImgUrl")
    public static void getImage(ImageView view, String petImgUrl) {
        Glide.with(view)
                .load(Constant.BaseUrl+"/sr-asset/v1/assets?a=v&p="+petImgUrl+"&tt=nm&at=FktJ4KBNfO2rSGRReHgl3iDASukWCV6433YjThww0nSOAL3FxZ0TukCXm/mQEVbJqugKJtYfN7YPwgtStauz7QQ6")
                .placeholder(R.drawable.icon_index_6) // 占位图，可选
                .error(R.drawable.icon_index_6) // 错误图，可选
                .into(view);
    }
}
